package entity

import (
	"fmt"
	"time"
)

type TestPaper struct {
	ID          int       `gorm:"primaryKey;autoIncrement:true;comment:主键"`
	Title       string    `gorm:"type:varchar(255);not null;comment:试卷名称"`
	QuestionIds string    `gorm:"type:varchar(255);not null;comment:题目列表"`
	UserName    string    `gorm:"type:varchar(255);not null;comment:发布者"`
	Status      int       `gorm:"type:int;not null;comment:审核状态"`
	CreatTime   time.Time `gorm:"column:creat_time;type:datetime;comment:创建时间;autoCreateTime"`
}

func (TestPaper) TableName() string {
	return "testPaper"
}

func (t TestPaper) ToString() string {
	return fmt.Sprintf(
		"TestPaper{ID=%d, QuestionIds=%v, UserName=%s, Status=%d, CreatTime=%s}",
		t.ID,
		t.QuestionIds,
		t.UserName,
		t.Status,
		t.CreatTime,
	)
}
